package second.actor

import scala.actors.Actor

/**
  * Created by feng on 24/11/2018.
  */
object MyActor1 extends Actor{
  override def act(): Unit ={
    for (i<- 1 to 20){
      println("actor-1 "+i)
      Thread.sleep(1000)
    }
  }
}

object MyActor2 extends Actor{
  override def act(): Unit ={
    for (i<-1 to 20){
      println("actor-2 "+i)
      Thread.sleep(1000)
    }
  }
}

object ActorTest extends App{
  MyActor1.start()
  MyActor2.start()
}
